<?php

namespace Wechat\MessageHandlers;

use think\Log;
use EasyWeChat\Kernel\Contracts\EventHandlerInterface;

class EventHandler implements EventHandlerInterface
{
    /**
     * @param mixed $payload
     */
    public function handle($payload = null)
    {
        switch ($payload['Event']) {
            //关注事件
            case 'subscribe':
                return '欢迎关注大成健康，请点击<a href="https://mk.deaigz.com/index/register/index">注册</a>';
            case 'unsubscribe':
                Log::info('有人偷偷取消了关注: '.var_export($payload, true));
            default:
                return 'SUCCESS';
        }
    }
}
